package com.software.form.interchangeform.dao;

import java.util.List;

public class InterchangeFormTransaction {

	private InterchangeFormDao interchangeFormDao;

	public InterchangeFormDao getInterchangeFormDao() {
		return interchangeFormDao;
	}

	public void setInterchangeFormDao(InterchangeFormDao interchangeFormDao) {
		this.interchangeFormDao = interchangeFormDao;
	}
	
	public boolean add(String company,String no,String user,String deliveryPlace,String deliverTo,
			String returnPlace,String voyage,String containerNo,String size,String optr,String sealNo,
			String truk,String pss_out,String pps_in,String time_out,String sagentEmail, String motoEmail){
		InterchangeForm icf = new InterchangeForm();
		icf.setNo(no);
		icf.setCompany(company);
		icf.setUser(user);
		icf.setDeliveryPlace(deliveryPlace);
		icf.setDeliverTo(deliverTo);
		icf.setReturnPlace(returnPlace);
		icf.setVoyage(voyage);
		icf.setContainerNo(containerNo);
		icf.setSize(size);
		icf.setOptr(optr);
		icf.setSealNo(sealNo);
		icf.setTruk(truk);
		icf.setPssout(pss_out);
		icf.setPpsin(pps_in);
		icf.setTimeout(time_out);
		icf.setSagentEmail(sagentEmail);
		icf.setMotoEmail(motoEmail);
		return interchangeFormDao.add(icf);
	}
	
	public List<InterchangeForm> getInterFormsByEmail(String email){
		return interchangeFormDao.queryBySagent(email);
	}
	
	public boolean updateMotoEmail(String no,String saemail,String motoemail){
		return interchangeFormDao.updateMotoEmail(no, saemail, motoemail);
	}
	
	public InterchangeForm getInterFormByNo(String no){
		return interchangeFormDao.queryByNo(no);
	}
}
